XNA/ACT-R Demo
--------------

Demonstrates how to link one or more ACT-R agent models to Microsoft's XNA game engine.


Directory Structure
-------------------
"ACT-R Source": Contains all the source code for the ACT-R environment. The directory also contains the Windows 32-bit executable of the ACT-R environment.

"ContentBuilder": Contains the source code to build the content for the XNA virtual environment.

"XNADemo": Contains the source code for the XNA virtual environment.


Configuration
-------------
By default the ACT-R environment will listen on port number 6666. This setting can be changed in the "main.lisp" file, which is located in the "ACT-R Source" directory. Note that of you change this setting, you will also need to change the ClientPortNumber setting in the "Game1.vb" file of the "XNA ACT-R Demo" project:

Private ClientPortNumber As Integer = 6666 ' the port number of the ACT-R client

By default XNA virtual environment assumes the ACT-R environment is running on the same machine as the virtual environment. It thus attempts to communicate with the ACT-R environment via the "127.0.0.1" IP address. If you want to run the ACT-R environment on a separate machine, you must specify the IP address of the client machine in the "Game1.vb" file of the "XNA ACT-R Demo" project:

Private ClientIPAddress As String = "127.0.0.1" 'the IP address of the ACT-R client


Instructions
------------

Open the solution file ("XNA ACT-R Demo.sln") in visual studio, and then build and run the solution. This will open two windows: the actual XNA virtual environment and a conventional windows form titled "ACT-R Monitor Form". The XNA virtual environment contains a single non-player character.

Double click on the ACT-R executable file ("actr6s-32.exe") in the "ACT-R Source" directory. This will launch the ACT-R environment.

Load the "main.lisp" file by typing '(load "main.lisp")' into the ACT-R command window. (The "main.lisp" file is located in the "ACT-R Source" directory.)

Type '(run-one-agent)' into the ACT-R command window. (This initiates execution of the ACT-R model.)

Click the 'Connect' button in the "ACT-R Monitor Form" window. (Connects the XNA virtual environment to the ACT-R environment.)

Click the 'Initialize' button in the "ACT-R Monitor Form" window. (Informs the ACT-R environment that the external environment is ready to receive instructions.)

The ACT-R model should now begin to firing productions. After about 14 seconds, the ACT-R model will start issuing instructions to the XNA game environment. This will result in the non-player character implementing actions within the XNA virtual environment.


More Information
----------------
The XNA virtual environment is built using Microsoft XNA Game Studio 4.0 (https://www.microsoft.com/en-gb/download/details.aspx?id=23714). It is written in VB.NET and was developed using Microsoft Visual Studio 2010.

The ACT-R code has been tested with version 6.0 of the ACT-R environment (http://act-r.psy.cmu.edu/act-r-6-0/).  


Contact
-------
Contact Paul Smart (ps02v@ecs.soton.ac.uk) should you encounter any problems.